-----------------------------------
-- Area: Sacrificial Chamber
-- NPC:  Mahogany Door
-- @pos 299 0 349 163
-------------------------------------
package.loaded["scripts/zones/Sacrificial_Chamber/TextIDs"] = nil;
package.loaded["scripts/globals/bcnm"] = nil;
-------------------------------------

require("scripts/globals/bcnm");
require("scripts/globals/missions");
require("scripts/zones/Sacrificial_Chamber/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
	
	if(TradeBCNM(player,player:getZone(),trade,npc))then
		return;
	end
	
end;

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
	
         if(player:hasKeyItem(SACRIFICIAL_CHAMBER_KEY)) then
			player:delKeyItem(SACRIFICIAL_CHAMBER_KEY);
			player:addKeyItem(DARK_FRAGMENT);
			player:messageSpecial(KEYITEM_OBTAINED,DARK_FRAGMENT);
			player:completeMission(ZILART,THE_TEMPLE_OF_UGGALEPIH);
			player:addMission(ZILART,HEADSTONE_PILGRIMAGE);
			player:messageSpecial(ITEM_OBTAINED,4306,1);
	end
	
end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
--printf("onUpdate CSID: %u",csid);
--printf("onUpdate RESULT: %u",option);
	
	if(EventUpdateBCNM(player,csid,option))then
		return;
	end
	
end;

-----------------------------------
-- onEventFinish Action
-----------------------------------

function onEventFinish(player,csid,option)
--printf("onFinish CSID: %u",csid);
--printf("onFinish RESULT: %u",option);
	
	if(EventFinishBCNM(player,csid,option))then
		return;
	end
	
end;